package com.zf.demo;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class GetBeanExample {
    public static void main(String[] args) {
        //1.得到容器对象
        ApplicationContext context = new ClassPathXmlApplicationContext("spring-config.xml");
        //2.获取Bean
          UserService userService = context.getBean(UserService.class);
        //3.使用Bean
        userService.func();
    }

}
